package com.sec.junit;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;

import ognl.Ognl;
import ognl.OgnlContext;
import ognl.OgnlException;

import com.sec.pojo.Test;

public class MainTest {
	public static void main(String[] args) throws OgnlException {
		OgnlContext context = new OgnlContext();
		
		Test test1 = new Test();
		test1.setUsername("111");
		
		Test test2 = new Test();
		test2.setUsername("222");
		
		Test test3 = new Test();
		test3.setUsername("333");
		
		
		context.put("test1", test1);
		context.put("test2", test2);
		context.put("test3", test3);
		context.setRoot(test3);
		
		Object value =Ognl.getValue("#test1.username.{? #this.}", context, test3);
		System.out.println(value);
		
	}
}
